﻿using System.Collections.Generic;
using System.Linq;

namespace Configuration.ServerApi.Enum
{
    /// <summary>
    /// 设备工位号
    /// </summary>
    public static class DeviceStationNumber
    {
        #region 设备工位号数据源

        /// <summary>
        /// 设备工位号数据源
        /// </summary>
        public static List<(string, int)> StationNumberData = new List<(string, int)>()
        {
            // 预留充电位: 10
            // 充电位: 20
            // 物料定位工位: 30
            (DeviceName.MaterialPositioningTable, 3),
            // 试管坩埚转换工位: 40
            (DeviceName.CrucibleConversion, 4),
            // 超声波清洗工位: 50
            (DeviceName.UltrasonicCleaningMachine, 5),
            // 球磨管开盖工位: 60
            (DeviceName.Capper2, 6),
            // 反应釜开盖工位: 70
            (DeviceName.Capper, 7),
            // 精密天平工位: 80
            (DeviceName.PrecisionBalance, 8),
            // 高通量配粉系统工位: 90
            (DeviceName.FlourBlending, 9),
            // 移液配比系统工位: 100
            (DeviceName.PipetteDistribution, 10),
            // 2#球磨机工位: 110
            (DeviceName.BallMilling2, 11),
            // 1#球磨机工位: 120
            (DeviceName.BallMilling, 12),
            // 鄂式破碎机工位: 130
            (DeviceName.Crusher, 13),
            // 陶瓷压片机工位: 140
            (DeviceName.TabletPress, 14),
            // 自动化电池封装机: 150
            (DeviceName.Packaging, 15),
            // 烘箱: 160
            (DeviceName.Oven, 16),
            // 下装炉: 170
            (DeviceName.BottomFurnace, 17),
            // 管式炉: 180
            (DeviceName.TubeFurnace, 18),
            // 固液测试平台工位: 190
            (DeviceName.SolidLiquidTesting, 19),
            // 固固测试平台工位: 200
            (DeviceName.SolidSolidTesting, 20),
            // XRD 测试仪器工位: 210
            (DeviceName.XRDDevice, 21),
        };

        #endregion

        #region 获取设备工位号

        /// <summary>
        /// 获取设备工位号
        /// </summary>
        /// <param name="DeviceName">设备名称</param>
        /// <returns>设备工位号</returns>
        public static int GetNumber(string DeviceName)
        {
            try
            {
                return StationNumberData.FirstOrDefault(w => DeviceName.Equals(w.Item1)).Item2;
            }
            catch
            {
                return 0;
            }
        }

        #endregion

    }
}
